require "test/unit"

class TestSimpleNumber < Test::Unit::TestCase
 
  def test_simple
    sn = SimpleNumber.new(2)
    result = sn.add(2)
    assert_equal(4, result )
    assert_equal(4, sn.multiply(2) )
  end
 
  def test_typecheck
    assert_raise( RuntimeError ) { SimpleNumber.new('a') }
  end
 
  def test_failure
    assert_equal(3, SimpleNumber.new(2).add(2), "Adding doesn't work" )
  end
 
end

